setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
load('CheackPointOne.RData')
head(pEhExvsCmasM,10);
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 45.32378 107.82734 128.66351 180.07428 446.15729 516.14317
## 2 EHI_000140A 66.04322 317.74653 257.32703 363.20067 351.59134 41.84945
## 3 EHI_000240A 700.57610 1282.45711 877.45524 1208.63415 1993.15918 2290.09468
## 4 EHI_000250A 707.05093 430.16227 388.98271 334.20566 337.04273 710.66559
## 5 EHI_000260A 94.53245 108.97444 35.15805 112.16491 69.10588 54.24928
## 6 EHI_000280A 58.27343 50.47237 80.78872 56.46397 86.07926 66.64912
## 7 EHI_000290A 27.19427 14.91229 23.93740 19.07567 14.54861 87.57384
## 8 EHI_000300A 60.86336 143.38742 110.71046 137.34479 118.81363 34.09955
## 9 EHI_000410A 15.53958 21.79489 23.18935 28.99501 25.46006 70.52407
## 10 EHI_000430A 27.19427 27.53039 22.44131 26.70593 14.54861 11.62485
nbreaks <- 10
data2 <- pEhExvsCmasM; head(data2)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 45.32378 107.82734 128.66351 180.07428 446.15729 516.14317
## 2 EHI_000140A 66.04322 317.74653 257.32703 363.20067 351.59134 41.84945
## 3 EHI_000240A 700.57610 1282.45711 877.45524 1208.63415 1993.15918 2290.09468
## 4 EHI_000250A 707.05093 430.16227 388.98271 334.20566 337.04273 710.66559
## 5 EHI_000260A 94.53245 108.97444 35.15805 112.16491 69.10588 54.24928
## 6 EHI_000280A 58.27343 50.47237 80.78872 56.46397 86.07926 66.64912
sample1 <- data2$pEhEx_1; sample2 <- data2$pEhEx_2; sample3 <- data2$pEhEx_3;
samplevs1 <- data2$CDC5_1; samplevs2 <- data2$CDC5_2; samplevs3 <- data2$CDC5_3;
log2sample1 <- log2(sample1+1); log2sample2 <- log2(sample2+1)
log2sample3 <- log2(sample3+1); log2samplevsCDC51 <- log2(samplevs1+1)
log2samplevsCDC52 <- log2(samplevs2+1); log2samplevsCDC53 <- log2(samplevs3+1)
data2 <- cbind(data2, log2sample1,log2sample2,log2sample3,
log2samplevsCDC51,log2samplevsCDC52,log2samplevsCDC53)
head(data2)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 45.32378 107.82734 128.66351 180.07428 446.15729 516.14317
## 2 EHI_000140A 66.04322 317.74653 257.32703 363.20067 351.59134 41.84945
## 3 EHI_000240A 700.57610 1282.45711 877.45524 1208.63415 1993.15918 2290.09468
## 4 EHI_000250A 707.05093 430.16227 388.98271 334.20566 337.04273 710.66559
## 5 EHI_000260A 94.53245 108.97444 35.15805 112.16491 69.10588 54.24928
## 6 EHI_000280A 58.27343 50.47237 80.78872 56.46397 86.07926 66.64912
## log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1 7.500438 8.804639 9.014420 5.533681 6.765897
## 2 8.508590 8.461853 5.421205 6.067020 8.316266
## 3 10.240355 10.961565 11.161821 9.454456 10.325819
## 4 8.388903 8.401062 9.475056 9.467709 8.752087
## 5 6.822283 6.131464 5.787884 6.577919 6.781024
## 6 5.844586 6.444257 6.079999 5.889314 5.685726
## log2samplevsCDC53
## 1 7.018629
## 2 8.013055
## 3 9.778825
## 4 8.607266
## 5 5.176245
## 6 6.353830
save.image('CheckPointThree.RData')
setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
#load('CheckPointTwo.RData')
library(ggplot2);library(dplyr);library("fitdistrplus");
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
## Loading required package: survival
library("MASS");library("survival")
head(data2)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 45.32378 107.82734 128.66351 180.07428 446.15729 516.14317
## 2 EHI_000140A 66.04322 317.74653 257.32703 363.20067 351.59134 41.84945
## 3 EHI_000240A 700.57610 1282.45711 877.45524 1208.63415 1993.15918 2290.09468
## 4 EHI_000250A 707.05093 430.16227 388.98271 334.20566 337.04273 710.66559
## 5 EHI_000260A 94.53245 108.97444 35.15805 112.16491 69.10588 54.24928
## 6 EHI_000280A 58.27343 50.47237 80.78872 56.46397 86.07926 66.64912
## log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1 7.500438 8.804639 9.014420 5.533681 6.765897
## 2 8.508590 8.461853 5.421205 6.067020 8.316266
## 3 10.240355 10.961565 11.161821 9.454456 10.325819
## 4 8.388903 8.401062 9.475056 9.467709 8.752087
## 5 6.822283 6.131464 5.787884 6.577919 6.781024
## 6 5.844586 6.444257 6.079999 5.889314 5.685726
## log2samplevsCDC53
## 1 7.018629
## 2 8.013055
## 3 9.778825
## 4 8.607266
## 5 5.176245
## 6 6.353830
log2sample1 <- data2$log2sample1; head(mean(log2sample1)); head(sd(log2sample1))
## [1] 6.460339
## [1] 2.834041
head(log2sample1,5)
## [1] 7.500438 8.508590 10.240355 8.388903 6.822283
summary(data2)
## GenId CDC5_1 CDC5_2 CDC5_3
## Length:4691 Min. : 0.0 Min. : 0.00 Min. : 0.0
## Class :character 1st Qu.: 19.4 1st Qu.: 19.50 1st Qu.: 20.9
## Mode :character Median : 50.5 Median : 56.21 Median : 54.6
## Mean : 1930.9 Mean : 1790.28 Mean : 2024.1
## 3rd Qu.: 209.8 3rd Qu.: 248.92 3rd Qu.: 223.3
## Max. :405707.4 Max. :282737.06 Max. :384267.8
## pEhEx_1 pEhEx_2 pEhEx_3 log2sample1
## Min. : 0.00 Min. : 0.00 Min. : 0.0 Min. : 0.000
## 1st Qu.: 19.84 1st Qu.: 18.19 1st Qu.: 17.0 1st Qu.: 4.381
## Median : 55.70 Median : 56.98 Median : 60.4 Median : 5.825
## Mean : 1503.81 Mean : 1895.10 Mean : 2146.4 Mean : 6.460
## 3rd Qu.: 227.38 3rd Qu.: 250.96 3rd Qu.: 272.4 3rd Qu.: 7.835
## Max. :219640.26 Max. :288237.01 Max. :781911.9 Max. :17.745
## log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 4.262 1st Qu.: 4.174 1st Qu.: 4.352 1st Qu.: 4.358
## Median : 5.858 Median : 5.941 Median : 5.687 Median : 5.838
## Mean : 6.424 Mean : 6.345 Mean : 6.361 Mean : 6.456
## 3rd Qu.: 7.977 3rd Qu.: 8.095 3rd Qu.: 7.720 3rd Qu.: 7.965
## Max. :18.137 Max. :19.577 Max. :18.630 Max. :18.109
## log2samplevsCDC53
## Min. : 0.000
## 1st Qu.: 4.456
## Median : 5.797
## Mean : 6.531
## 3rd Qu.: 7.809
## Max. :18.552
ndata2 <- length(log2sample1)
hist(log2sample1, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample1')
meanlog2sample1 <- mean(log2sample1); head(meanlog2sample1)
## [1] 6.460339
StdDevlog2sample1 <- sd(log2sample1); head(StdDevlog2sample1)
## [1] 2.834041
Normlog2sample1 <- (log2sample1-meanlog2sample1)/StdDevlog2sample1; head(Normlog2sample1)
## [1] 0.3670021 0.7227316 1.3337904 0.6804997 0.1277131 -0.2172704
tst<- Normlog2sample1
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 3.118970e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CĂ¡lculo de cuantiles
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8599158 0.8169091
## 70 -0.9371527 0.9617338
## 75 -0.9960331 1.1293972
## 80 -1.0282412 1.3839029
## 85 -1.0995019 1.7041875
## 90 -1.1392596 2.1899810
## 95 -1.2814439 2.6187913
## 99 -1.6734604 3.1869302
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2sample2 <- data2$log2sample2; head(mean(log2sample2)); head(sd(log2sample2))
## [1] 6.424318
## [1] 3.078114
head(log2sample2,5)
## [1] 8.804639 8.461853 10.961565 8.401062 6.131464
ndata2 <- length(log2sample2)
hist(log2sample2, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample2')
Log-normalizacion
meanlog2sample2 <- mean(log2sample2); head(meanlog2sample2)
## [1] 6.424318
StdDevlog2sample2 <- sd(log2sample2); head(StdDevlog2sample2)
## [1] 3.078114
Normlog2sample2 <- (log2sample2-meanlog2sample2)/StdDevlog2sample2; head(Normlog2sample2)
## [1] 0.773304903 0.661942766 1.474034750 0.642193202 -0.095140848
## [6] 0.006477743
tst<- Normlog2sample2
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajuste de modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -7.845328e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8804743 0.8477586
## 70 -0.9259047 0.9845324
## 75 -0.9762161 1.1416416
## 80 -1.0325848 1.3729846
## 85 -1.1709305 1.7147626
## 90 -1.2592113 2.1352442
## 95 -1.5101169 2.5267006
## 99 -2.0870956 3.0982665
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2sample3 <- data2$log2sample3; head(mean(log2sample3)); head(sd(log2sample3))
## [1] 6.345251
## [1] 3.202711
head(log2sample3,5)
## [1] 9.014420 5.421205 11.161821 9.475056 5.787884
ndata2 <- length(log2sample3)
hist(log2sample3, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample2')
meanlog2sample3 <- mean(log2sample3); head(meanlog2sample3)
## [1] 6.345251
StdDevlog2sample3 <- sd(log2sample3); head(StdDevlog2sample3)
## [1] 3.202711
Normlog2sample3 <- (log2sample3-meanlog2sample3)/StdDevlog2sample3; head(Normlog2sample3)
## [1] 0.83340927 -0.28851998 1.50390416 0.97723608 -0.17402974 -0.08282095
tst<- Normlog2sample3
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando Modelos
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 2.404120e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1.000000e+00 1.713307e-11
## sd 1.713307e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8675316 0.8402759
## 70 -0.9659157 0.9685687
## 75 -1.0459211 1.1104543
## 80 -1.1432722 1.3204414
## 85 -1.2676335 1.6079001
## 90 -1.4400018 1.9997962
## 95 -1.7227405 2.4584046
## 99 -1.9812123 3.0490511
CreaciĂ³n de histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC51 <- data2$log2samplevsCDC51; head(mean(log2vsCDC51)); head(sd(log2vsCDC51))
## [1] 6.360533
## [1] 2.885557
head(log2vsCDC51,5)
## [1] 5.533681 6.067020 9.454456 9.467709 6.577919
ndata2 <- length(log2vsCDC51)
hist(log2vsCDC51, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC51')
meanlog2vsCDC51 <- mean(log2vsCDC51); head(meanlog2vsCDC51)
## [1] 6.360533
StdDevlog2vsCDC51 <- sd(log2vsCDC51); head(StdDevlog2vsCDC51)
## [1] 2.885557
Normlog2vsCDC51 <- (log2vsCDC51-meanlog2vsCDC51)/StdDevlog2vsCDC51; head(Normlog2vsCDC51)
## [1] -0.28654857 -0.10171821 1.07220996 1.07680301 0.07533583 -0.16330282
tst<- Normlog2vsCDC51
Primer histograma
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC51',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 4.727431e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1.000000e+00 3.426614e-11
## sd 3.426614e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8422310 0.8070408
## 70 -0.8866144 0.9258394
## 75 -0.9353250 1.1082535
## 80 -0.9892988 1.3411647
## 85 -1.0498123 1.6503084
## 90 -1.1186718 2.1232202
## 95 -1.2936703 2.7259168
## 99 -2.2042655 3.3471237
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC52 <- data2$log2samplevsCDC52; head(mean(log2vsCDC52)); head(sd(log2vsCDC52))
## [1] 6.456006
## [1] 2.961412
head(log2vsCDC52,5)
## [1] 6.765897 8.316266 10.325819 8.752087 6.781024
Primer Histograma
ndata2 <- length(log2vsCDC52)
hist(log2vsCDC52, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC52')
meanlog2vsCDC52 <- mean(log2vsCDC52); head(meanlog2vsCDC52)
## [1] 6.456006
StdDevlog2vsCDC52 <- sd(log2vsCDC52); head(StdDevlog2vsCDC52)
## [1] 2.961412
Normlog2vsCDC52 <- (log2vsCDC52-meanlog2vsCDC52)/StdDevlog2vsCDC52; head(Normlog2vsCDC52)
## [1] 0.1046430 0.6281664 1.3067458 0.7753331 0.1097511 -0.2601055
tst<- Normlog2vsCDC52
** Segundo Histograma**
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC52',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -1.572806e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
CĂ¡lculo de cuantiles
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8684632 0.8127421
## 70 -0.9078618 0.9668311
## 75 -0.9977360 1.1263553
## 80 -1.0497676 1.3726202
## 85 -1.1080283 1.6925494
## 90 -1.1742151 2.1332703
## 95 -1.3417825 2.5710200
## 99 -2.1800429 3.1603637
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC53 <- data2$log2samplevsCDC53; head(mean(log2vsCDC53)); head(sd(log2vsCDC53))
## [1] 6.53086
## [1] 2.83016
head(log2vsCDC53,5)
## [1] 7.018629 8.013055 9.778825 8.607266 5.176245
ndata2 <- length(log2vsCDC53)
** Primer histograma**
hist(log2vsCDC53, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC53')
meanlog2vsCDC53 <- mean(log2vsCDC53); head(meanlog2vsCDC53)
## [1] 6.53086
StdDevlog2vsCDC53 <- sd(log2vsCDC53); head(StdDevlog2vsCDC53)
## [1] 2.83016
Normlog2vsCDC53 <- (log2vsCDC53-meanlog2vsCDC53)/StdDevlog2vsCDC53; head(Normlog2vsCDC53)
## [1] 0.17234655 0.52371392 1.14762562 0.73367078 -0.47863552 -0.06255138
tst<- Normlog2vsCDC53
Segundo histograma
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC53',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 4.356074e-17 0.01459893
## sd 9.998934e-01 0.01032296
## Loglikelihood: -6655.741 AIC: 13315.48 BIC: 13328.39
## Correlation matrix:
## mean sd
## mean 1.000000e+00 -3.426614e-11
## sd -3.426614e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
Calculo de cuantiles
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8498210 0.8013314
## 70 -0.8954944 0.9236834
## 75 -0.9456663 1.1144463
## 80 -1.0013208 1.3533967
## 85 -1.0316061 1.7113380
## 90 -1.0981755 2.2519051
## 95 -1.2178539 2.7028284
## 99 -1.5625210 3.3998336
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))